<extend name="Public:base" />
<block name="main">

<div class="col-lg-12">
	<div class="widget-container fluid-height clearfix">
		<div class="heading">
			<div class="pull-left"><h3>模块{$md}的设计</h3></div>
			<!-- <div class="pull-right"><a ajax-dialog href="{:U("Mod/add_mdel")}">新增自定义</a></div> -->
		</div>
		<div class="widget-content padded">
			<table class="table table-bordered table-condensed">
				<thead>
					<th>表名</th>
					<th>控制器</th>
					<th>模型</th>
					<th>#</th>
				</thead>
				<tbody>
					<volist name="data" id="tb">
					<tr>
						<td>{$tb.tbName}</td>
						<td>
							
							[ <eq name="tb[isCon]" value="1">
								<a ajax class="btn-danger" href="{:U("Mod/delete?md=$md&name=$tb[mdName]&type=Con&ap=$ap")}">删除</a>
							<else/>
								<a ajax href="{:U("Mod/create?md=$md&name=$tb[mdName]&type=Con&ap=$ap")}">生成</a>
							</eq> ]
							{$tb.mdName}
						</td>
						<td>
							[ <eq name="tb[isModel]" value="1">
								<a ajax class="btn-danger" href="{:U("Mod/delete?md=$md&name=$tb[mdName]&type=Model&ap=$ap")}">删除</a>
							<else/>
								<a ajax href="{:U("Mod/create?md=$md&name=$tb[mdName]&type=Model&ap=$ap")}">生成</a>
							</eq> ]
							{$tb.conName}
						</td>
						<td>
							<a target="_blank" href="{:U("Forms/index?md=$md&tb=$tb[tbName]&ap=$ap")}">表单设计</a>
						</td>
					</tr>
					</volist>
					<tr>
						<td align="center" colspan="4">其他控制器</td>
					</tr>
					<volist name="other_cons" id="con">
					<tr>
						<td colspan="4">{$con}</td>
					</tr>
					</volist>

					<tr>
						<td align="center" colspan="4">其控模型</td>
					</tr>
					<volist name="other_models" id="con">
					<tr>
						<td colspan="4">{$con}</td>
					</tr>
					</volist>
				</tbody>
			</table>
		</div>
	</div>
</div>

<script type="text/javascript">
$(function(){
	$('a[ajax]').on('click',function(e){
		e.preventDefault();
		var url  = $(this).attr('href');
		$.get(url,function(){
			window.location.reload();
		})
	})
})	
</script>
</block>
